package com.xxs.controller.admin;

import com.jfinal.aop.Before;
import com.jfinal.core.Controller;
import com.jfinal.kit.JMap;
import com.jfinal.kit.PathKit;
import com.jfinal.template.Engine;
import com.jfinal.template.Template;
import com.xxs.interceptor.AdminInterceptor;

/**
 * 站点管理
 */
@Before(AdminInterceptor.class)
public class GenerateController extends Controller {
	public void build(){
		String siteCode = getPara(0);
		System.out.println("siteCode:"+siteCode);
		//生成首页
    	Engine engine = new Engine();
    	String webPath = PathKit.getWebRootPath();
    	engine.setBaseTemplatePath(webPath);
    	Template template = engine.getTemplate("db/"+siteCode+"/front/index.html");
    	String res = template.renderToString(JMap.create("_files","xxxxxx"));
    	System.out.println(res);
    	engine = Engine.use("index11111");
		
		//生成文档
		//生成内容
    	renderText("生成成功！！！");
    }
}
